<?php
$viewdefs ['edanz_Rates'] = array (
	'EditView' => array (
		'templateMeta' => array (
			'maxColumns' => '2',
			'widths' => array (
				array (
					'label' => '10',
					'field' => '30',
				),
				array (
					'label' => '10',
					'field' => '30',
				),
			),
			'form' => array (
				'buttons' => array(
					0 => array( 
						'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}"  accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="disableOnUnloadEditView(this.form) ; this.form.action.value=\'Save\'; return check_form(EditView); " type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" id="'.$type.$location.'">',
					),
					1 => 'CANCEL',
				),
			),
			'javascript' => '<script type="text/javascript" language="Javascript">
							function check_form(form) {ldelim}
								if (trim(form.rate.value) == "") {ldelim}
									alert("Missing required field: Rate");
									return false;
								{rdelim}
								else if (trim(form.applies_from.value) == "" && trim(form.total_size_from.value) == "") {ldelim}
									alert("Missing required field: Unit");
									return false;
								{rdelim}	
							{rdelim}
							function unit_controller(form) {ldelim}
								if (document.getElementById("applies_from").value != "" || document.getElementById("applies_to").value != "") {ldelim}
									document.getElementById("total_size_from").readOnly=true;
									document.getElementById("total_size_from").style.backgroundColor="gray" ;
									document.getElementById("total_size_to").readOnly=true;
									document.getElementById("total_size_to").style.backgroundColor="gray" ; 
								{rdelim}
								else {ldelim}
									document.getElementById("total_size_from").readOnly=false;
									document.getElementById("total_size_from").style.backgroundColor="#FFFFFF" ;
									document.getElementById("total_size_to").readOnly=false;
									document.getElementById("total_size_to").style.backgroundColor="#FFFFFF" ; 
								{rdelim}
								if (document.getElementById("total_size_from").value != "" || document.getElementById("total_size_to").value != "" ) {ldelim}
									document.getElementById("applies_from").readOnly=true;
									document.getElementById("applies_from").style.backgroundColor="gray" ;
									document.getElementById("applies_to").readOnly=true;
									document.getElementById("applies_to").style.backgroundColor="gray" ; 
								{rdelim}
								else  {ldelim}
									document.getElementById("applies_from").readOnly=false;
									document.getElementById("applies_from").style.backgroundColor="#FFFFFF" ;
									document.getElementById("applies_to").readOnly=false;
									document.getElementById("applies_to").style.backgroundColor="#FFFFFF" ; 
								{rdelim}
							{rdelim}
							</script>',
		),
		'panels' => array (
			'default' => array (
								array (
                                        'rate',
                                        'service',
                                ),
                                array (
                                	array(
                                		'label' => 'LBL_UNIT',
                                		'customCode'=>'{$MOD.LBL_APPLIES_FROM}<br><input type="text" name="applies_from" id="applies_from" size="3" value="{$fields.applies_from.value}" title="" tabindex="102" onchange="unit_controller(EditView);" >{$MOD.LBL_APPLIES_TO}<input type="text" name="applies_to" id="applies_to" size="3" value="{$fields.applies_to.value}" title="" tabindex="102" onchange="unit_controller(EditView);">pages/hours/assignments<br>or<br>{$MOD.LBL_TOTAL_SIZE_FROM}<br><input type="text" name="total_size_from" id="total_size_from" size="3" value="{$fields.total_size_from.value}" title="" tabindex="102" onchange="unit_controller(EditView);">{$MOD.LBL_TOTAL_SIZE_TO}<input type="text" name="total_size_to" id="total_size_to" size="3" value="{$fields.total_size_to.value}" title="" tabindex="102" onchange="unit_controller(EditView);">pages/hours/assignments',
                                	),
                                        'task_type',
                                ),
								array (
                                        array(
                                        	'name'=>'unit_type',
                                        	'type' => 'radioenum',
                                        ),
                                        'business_region',
                                ),
                                array (
                                        'speed',
                                ),
                              
                                array (
                                        'complexity',
                                ),
			),
		),
	),
);
?>
